﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="sponsoruknow.aspx.cs" Inherits="en_member_become" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>赞助"艺述英国"</title>
<!-- #include file="/include/tag/cn_cssjs.html" -->
<script type="text/javascript">
	$(function() {
		$("#hideUserName").val($("#tbxUserName").val());
		$("#hidePhoneNum").val($("#tbxPhone").val());
		$("#hideMail").val($("#tbxUserMail").val());
		$("#hideNature").val($("#tbxNature").val());
		$("input:text").focus(function() {
			if ($(this).val() == this.defaultValue) {
				$(this).val("");
			}
		}).blur(function() {
		});
		$('input[id$=tbxUserMail]').blur(function() {
			ValidateMail(false);
		});
		$('input[id$=tbxUserName]').blur(function() {
			ValidateUserInfo(false);
		});
		$('input[id=tbxPhone]').blur(function() {
			ValidatePhone(true);
		});
		$("#lkbSubmit").click(function() {
			ValidateInfo(true);
		});
	});

	//验证表单信息
	function ValidateInfo(flag) {
		ValidateMail(flag);
		ValidateUserInfo(flag);
		ValidatePhone(flag);
	}
	//手机号码验证
	function ValidatePhone(flag) {
		$('#errorMobile').find("span").empty().end().hide();
		var $phoneNum = $('input[id=tbxPhone]').val();
		if ($phoneNum == $("#hidePhoneNum").val()) {
			$phoneNum = "";
		}
		if (flag) {
			if (($phoneNum != "") && ($phoneNum != $("#hidePhoneNum").val())) {
				var phoneReg = /^1[3|4|5|8][0-9]\d{4,8}$/;
				
				if (!phoneReg.test($phoneNum)) {
					$('#errorMobile').show().append("<span>无效的手机号码,请重试</span>");
				}
			}
		}


	}

	//邮箱信息验证
	function ValidateMail(flag) {
		var mailFlag = false;
		$('#errorEmail').find("span").empty().end().hide();
		var $userMail = $('input[id$=tbxUserMail]').val();
		var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
		if ($userMail == $("#hideMail").val()) {
			$userMail = "";
		}
		if (flag) {
			if ($.trim($userMail) == "") {
				$('#errorEmail').show().append("<span>请输入电子邮件地址</span>");
			}
			else {
				if (!emailReg.test($userMail)) {
					$('#errorEmail').show().append("<span>请输入有效的电子邮件地址</span>");
				}
				else {
					mailFlag = true;
				}
			}
		}
		else {
			if ($.trim($userMail) != "") {
				if (!emailReg.test($userMail)) {
					$('#errorEmail').show().append("<span>请输入有效的电子邮件地址</span>");
				}
				else {
					mailFlag = true;
				}
			}
		}
		if (mailFlag) {
			$('#imageEmailInfo').show().attr('src', 'images/UK_icon05.gif');
		}
		else {
			$('#imageEmailInfo').show().attr('src', 'images/UK_icon06.gif');
		}

	}

	//用户信息验证
	function ValidateUserInfo(flag) {
		var userNameflag = false;
		$('#errorUserName').find("span").empty().end().hide();
		var $userName = $('input[id$=tbxUserName]').val();
		var $userNameReg = /^\w+$/; //只能输入由数字、26个英文字母或者下划线组成的字符串
		if ($userName == $("#hideUserName").val()) {
			$userName = "";
		}
		if (flag) {
			if ($.trim($userName) == "") {
				$('#errorUserName').show().append("<span>请输入您的用户名</span>");
			}
			else {
				if ($userName.length < 4 || $userName.length > 30) {
					$('#errorUserName').show().append("<span>用户名长度为4到10位</span>");
				}
				else {
					if (!$userNameReg.test($userName)) {
						$('#errorUserName').show().append("<span>用户名由字母、数字或下划线组成,请重试</span>");
					}
					else {
						userNameflag = true;
					}
				}

			}
		}
		else {
			if ($.trim($userName) != "") {
				if ($userName.length < 4 || $userName.length > 30) {
					$('#errorUserName').show().append("<span>用户名长度为4到10位</span>");
				}
				else {
					if (!$userNameReg.test($userName)) {
						$('#errorUserName').show().append("<span>用户名由字母、数字或下划线组成,请重试</span>");
					}
					else {
						userNameflag = true;
					}
				}
			}

		}
		//            $.ajax({
		//                type: "POST",
		//                url: "become.aspx/IsUserAvailable",
		//                data: "{'username': '" + $userName + "'}",
		//                contentType: "application/json; charset=utf-8",
		//                dataType: "json",
		//                async: false,
		//                success: function(msg) {
		//                    var delay = function() {
		//                        userNameflag = AjaxSucceeded(msg);
		//                    };

		//                    setTimeout(delay, 1000);
		//                },
		//                error: Failed
		//            });
		if (userNameflag) {
			$('#imageUserNameInfo').show().attr('src', 'images/UK_icon05.gif');
		}
		else {
			$('#imageUserNameInfo').show().attr('src', 'images/UK_icon06.gif');
		}
	}

	function AjaxSucceeded(data) {

		if (eval(data.d) == "1") {
			$('dl.leave').find('dd').eq(0).append("<span style='color:red'>该用户已经存在</span>");

		}
	}

	function Failed() {
	}
   
</script>

</head>
<body>
    <form id="form1" runat="server">
    
    <div id="main">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
  <div class="ukContent">
    <div class="ukLeft">
      <!-- #include file="/include/tag/cn_logo.html" -->
      <%=menuModel.GetLeftNavi() %>
      <!-- #include file="/include/tag/cn_search.html" -->
      <!-- #include file="/include/tag/cn_left_ad.html" -->
    </div>
    <div class="ukRight">
      <!-- #include file="/include/tag/cn_login.html" -->
      <h1 class="reg"><img src="images/UK_title02.gif" alt="sponsor one of uk now's exciting events!" /></h1>
      <div class="ukDiagoe">
        <h2><img src="images/UK_sponsor_pic01.jpg"  alt="" /></h2>
        <p>现在，我们将为中国和国际企业提供机会，以特定活动赞助商的形式参与文化节活动。同时为其提供建立媒体合作伙伴关系的契机。
          品牌可见度和曝光度在中英两国将得到有效提升，这会是无以伦比的机遇。重点包括：</p>
        <p><img src="images/UK_sponsor_pic02.jpg" alt="" /></p>
      </div>
      <div class="ukBecome"> 如果您想了解更多，请直接联系我们或者按照提示信息留下您的联系方式，我们会和您取得联系。 </div>
      <div class="ukSearchResults">
        <h3><img src="images/UK_3.2becomeCN_01.gif" alt="" /></h3>
        <dl class="contact">
          <dt>电话</dt>
          <dd>86 (0) 10 65906903-206</dd>
          <dt>传真</dt>
          <dd>86 (0)10 65900977</dd>
          <dt>电子邮件</dt>
          <dd>uk.now@britishcouncil.org.cn</dd>
          <dt>地址</dt>
          <dd>中国北京东三环北路8号亮马河大厦1号楼4层，英国大使馆文化教育处 </dd>
          <dt>邮编</dt>
          <dd>100004</dd>
        </dl>
        <div class="clear"></div>
      </div>
      <div class="ukSearchResults">
        <h3><img src="images/UK_3.2becomeCN_02.gif" alt="" /></h3>
        <dl class="leave">
          <dt>姓名（人名/公司名）<span>*</span></dt>
          <dd>
             <asp:TextBox ID="tbxUserName" runat="server" Text="请输入您的姓名（人名/公司名）" MaxLength="30"></asp:TextBox>
          </dd>
           <dt class="red" style="display: none" id="errorUserName"></dt>
          <dt>电子邮件 <span>*</span></dt>
          <dd>
            
             <asp:TextBox ID="tbxUserMail" runat="server" Text="请输入你的常用邮箱"></asp:TextBox>
          </dd>
           <dt class="red" style="display: none" id="errorEmail"></dt>
          <dt>电话号码 </dt>
          <dd>
              <asp:TextBox ID="tbxPhone" runat="server" Text="请正确填写手机号"></asp:TextBox>
          </dd>
           <dt class="red" style="display: none" id="errorMobile"></dt>
          <dt>问题种类 </dt>
          <dd>
            <%--<input type="text" value="赞助、媒体、合作、其他" />--%>
             <asp:TextBox ID="tbxNature" runat="server" Text="赞助、媒体、合作、其他"></asp:TextBox>
          </dd>
          <dt class="all">带<span>*</span>号为必填 </dt>
        </dl>
        <div class="clear"></div>
        <div class="ukSubmit"> 
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <asp:LinkButton ID="lkbSubmit" runat="server" OnClick="lkbSubmit_Click"><img src="images/UK_submit.gif" alt="submit" id="submit" /></asp:LinkButton>
            </ContentTemplate>
            </asp:UpdatePanel>
</div>
      </div>
    </div>
    <div class="clear"></div>
  </div>
  <!-- #include file="/include/tag/cn_footer.html" -->
</div>
 <asp:HiddenField ID="hideUserName" runat="server" />
   <asp:HiddenField ID="hidePhoneNum" runat="server" />
    <asp:HiddenField ID="hideMail" runat="server" />
      <asp:HiddenField ID="hideNature" runat="server" />

    </form>
    <!-- START OF SmartSource Data Collector TAG -->
    <!-- Copyright (c) 1996-2009 WebTrends Inc.  All rights reserved. -->
    <!-- Version: 8.6.2 -->
    <!-- Tag Builder Version: 3.0  -->
    <!-- ----------------------------------------------------------------------------------- -->
    <!-- Warning: The two script blocks below must remain inline. Moving them to an external -->
    <!-- JavaScript include file can cause serious problems with cross-domain tracking.      -->
    <!-- ----------------------------------------------------------------------------------- -->

    <script type="text/javascript">
        //<![CDATA[
        var _tag = new WebTrends();
        _tag.fpcdom = ".uknow.org.cn";
        _tag.dcsGetId();
        //]]>>
    </script>

    <script type="text/javascript">
        //<![CDATA[
        // Add custom parameters here.
        //_tag.DCSext.param_name=param_value;
        _tag.WT.sp = "China_uknow_sponsorUKNow";
        _tag.dcsCollect();
        //]]>>
    </script>

    <noscript>
        <div>
            <img alt="DCSIMG" id="DCSIMG" width="1" height="1" src="http://statse.webtrendslive.com/dcsozkqgb00000sh0y1unaabw_9e3r/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.6.2" /></div>
    </noscript>
    <!-- END OF SmartSource Data Collector TAG -->
</body>
</html>
